//
//  NSObject+CZQ.m
//  LoveBeer
//
//  Created by 崔正强 on 17/5/4.
//  Copyright © 2017年 崔正强. All rights reserved.
//

#import "NSObject+CZQ.h"
#import "MBProgressHUD.h"
#import <QuartzCore/QuartzCore.h>

@implementation NSObject (CZQ)

- (void)customViewExampleWithImage:(NSString *)imgName title:(NSString *)title View:(UIView *)view{
    
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    
    hud.mode = MBProgressHUDModeCustomView;
    
    UIImage *image = [[UIImage imageNamed:imgName] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
    
    hud.customView = [[UIImageView alloc] initWithImage:image];
    
    hud.square = YES;
    
    hud.label.text = NSLocalizedString(title, @"HUD done title");
    
    [hud hideAnimated:YES afterDelay:3.f];
    
}

@end
